package com.itheima.reggie.controllerApi;

import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.Category;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author kcs
 * @date 2021/12/8
 * @TIME:15:21
 */
@Api(description = "瑞吉外卖分类管理API") //对类进行附加说明
public interface CategoryControllerApi {

    @ApiOperation("新增分类接口") //用来描述方法的作用
    public R add(@RequestBody Category category);

    @ApiOperation("分页查询分类信息接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "页码",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页记录数",required = true),
            @ApiImplicitParam(name = "name",value = "套餐名称",required = false)
    })
    public R page(Integer page,Integer pageSize);

    @ApiOperation("修改分类接口")
    public R update(@RequestBody Category category);

    @ApiOperation("根据id删除分类信息接口")
    public R delete(Long id);

    @ApiOperation("查询分类信息接口")
    public R list(Integer type);

}
